package com.controller;

import com.service.InventoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * @description:
 * @author: sksun2
 * @create: 2023-07-24
 */
@RequestMapping()
@RestController
public class InventoryController {

    @Autowired
    private InventoryService inventoryService;

    /**
     * 扣库存
     * @param itemId
     * @param num
     * @return
     */
    @RequestMapping("adjust")
    public String adjust(HttpServletRequest request,String itemId, Integer num){
        final String requestURI = request.getRequestURI();
        System.out.println("调用库存系统");
        inventoryService.adjust(itemId,num);
        return "ok";
    }

}
